﻿package mortal.game.view.guildNew.info
{
    import com.mui.controls.*;
    import extend.language.*;
    import flash.events.*;
    import mortal.common.global.*;
    import mortal.game.events.*;
    import mortal.game.view.common.*;
    import mortal.game.view.guildNew.data.*;
    import mortal.mvc.core.*;

    public class GuildNewInfoBtnCell extends GSprite
    {
        protected var _btn:GButton;
        protected var _nameTxt:GTextFiled;
        protected var _infoTxt:GTextFiled;
        private var _info:Object;

        public function GuildNewInfoBtnCell()
        {
            return;
        }// end function

        override protected function createDisposedChildrenImpl() : void
        {
            super.createDisposedChildrenImpl();
            this._btn = UIFactory.gButton("", 0, 0, 122, 40, this);
            this._nameTxt = UIFactory.gTextField("" + Language.getString(71455), 57, 1, 100, 20, this, GlobalStyle.textFormatLv.setUnderline(true));
            this._infoTxt = UIFactory.gTextField("" + Language.getString(71456), 32, 21, 100, 20, this, GlobalStyle.textFormatPutong.setColor(16777215).center());
            this.addChild(this._btn);
            this._btn.alpha = 0.01;
            this._btn.configEventListener(MouseEvent.CLICK, this.onCkHd);
            return;
        }// end function

        override protected function disposeImpl(param1:Boolean = true) : void
        {
            super.disposeImpl(param1);
            this._btn = null;
            this._nameTxt = null;
            this._infoTxt = null;
            return;
        }// end function

        public function updateInfo(param1:Object) : void
        {
            this._info = param1;
            if (isDisposed || param1 == null)
            {
                return;
            }
            this._nameTxt.text = "" + param1.state;
            this._infoTxt.text = "" + param1.info;
            if ("" + Language.getString(71457) == this._nameTxt.text)
            {
                this._btn.toolTipData = "" + Language.getString(71458);
            }
            return;
        }// end function

        private function onCkHd(event:MouseEvent) : void
        {
            Dispatcher.dispatchEvent(new DataEvent(GuildNewLocalEvent.GuildNewInfoOper, this._info));
            return;
        }// end function

    }
}
